package main.resources.controller.command.lesson;

import main.resources.controller.command.Command;
import main.resources.controller.dao.moodle.MdlLessonDao;
import main.resources.exceptions.DaoException;
import main.resources.model.entity.moodle.MdlLesson;

public class LessonRemoveCommand implements Command {

	private MdlLesson lesson;
	private String id;
	
	public LessonRemoveCommand(String id) {
		this.id = id;
	}

	@Override
	public void execute() throws DaoException {
		this.lesson = MdlLessonDao.getInstance().find(id);
		MdlLessonDao.getInstance().remove(lesson);
	}

}
